<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template quantity</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../boost_units/Reference.html#doxygen.units_reference.quantity_8hpp" title="Header &lt;boost/units/quantity.hpp&gt;">
<link rel="prev" href="structboost_1_1units_1_1add__typeof__helper_3_01quantity_3_01unit_3_01Dim1_00_01System1_01_4_00_c1e57319263083d9bd57c0be91d8b3ac.html" title="Struct template add_typeof_helper&lt;quantity&lt; unit&lt; Dim1, System1 &gt;, X &gt;, quantity&lt; unit&lt; Dim2, System2 &gt;, Y &gt;&gt;">
<link rel="next" href="classboost_1_1units_1_1quantity_3_01BOOST__UNITS__DIMENSIONLESS__UNIT_07System_08_00_01Y_01_4.html" title="Class template quantity&lt;BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y&gt;">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="structboost_1_1units_1_1add__typeof__helper_3_01quantity_3_01unit_3_01Dim1_00_01System1_01_4_00_c1e57319263083d9bd57c0be91d8b3ac.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_units/Reference.html#doxygen.units_reference.quantity_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="classboost_1_1units_1_1quantity_3_01BOOST__UNITS__DIMENSIONLESS__UNIT_07System_08_00_01Y_01_4.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.units_reference.classboost_1_1units_1_1quantity"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template quantity</span></h2>
<p>boost::units::quantity — class declaration </p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../boost_units/Reference.html#doxygen.units_reference.quantity_8hpp" title="Header &lt;boost/units/quantity.hpp&gt;">boost/units/quantity.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Unit<span class="special">,</span> <span class="keyword">typename</span> Y<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit</span><span class="special">,</span> <span class="identifier">Y</span> <span class="special">&gt;</span> <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1a5670a28c51eccb5c3355a448979a3c6e"></a><span class="identifier">this_type</span><span class="special">;</span> 
  <span class="keyword">typedef</span> <span class="identifier">Y</span>                   <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1ade1397f802a46a7f82ced7799adadcd5"></a><span class="identifier">value_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">Unit</span>                <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1aed3f80fe31d08d9d8626caac5a0d476d"></a><span class="identifier">unit_type</span><span class="special">;</span> 

  <span class="comment">// <a class="link" href="classboost_1_1units_1_1quantity.html#id-1_3_42_10_2_36_1_1_3_6-bb">private member functions</a></span>
   <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1a0290aea428552371c2f3740da6a1d751"><span class="identifier">BOOST_MPL_ASSERT_NOT</span></a><span class="special">(</span><span class="emphasis"><em><span class="identifier">unspecified</span></em></span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1units_1_1quantity.html#id-1_3_42_10_2_36_1_1_3_7-bb">public member functions</a></span>
  <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1a484474125b77a2e6ef9e1de01c8c54a9"><span class="identifier">quantity</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1a318bce2dda5327260598a283bf76e8ad"><span class="identifier">quantity</span></a><span class="special">(</span><span class="identifier">unspecified_null_pointer_constant_type</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1af73d7de246f97df78d4de8787afdde79"><span class="identifier">quantity</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">this_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1a3a16f2160d275e7f55db52552472bf65"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">this_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> YY<span class="special">&gt;</span> 
    <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1a705d20a31b83ed9f9d19c1bdbe2059b9"><span class="identifier">quantity</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> YY<span class="special">&gt;</span> 
    <span class="keyword">explicit</span> <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1a4697636705c2804719498ff8640c8776"><span class="identifier">quantity</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> YY<span class="special">&gt;</span> 
    <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1a3f47d4706ca778972a1a8edb9bed1688"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Unit2<span class="special">,</span> <span class="keyword">typename</span> YY<span class="special">&gt;</span> 
    <span class="keyword">explicit</span> <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1a00e7e3bc37ecff448f8a84ddbc5bdca0"><span class="identifier">quantity</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit2</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Unit2<span class="special">,</span> <span class="keyword">typename</span> YY<span class="special">&gt;</span> 
    <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1ad95a1c6209daa48be549a3e2801a1fa7"><span class="identifier">quantity</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit2</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Unit2<span class="special">,</span> <span class="keyword">typename</span> YY<span class="special">&gt;</span> 
    <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1ac098018ddf73086447ee282dc65b7425"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit2</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">BOOST_CONSTEXPR</span> <span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span> <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1a140ecba6b11b57ba6c65d8f795d91e0c"><span class="identifier">value</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Unit2<span class="special">,</span> <span class="keyword">typename</span> YY<span class="special">&gt;</span> 
    <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> 
    <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1a6a770b3a169018dcff09142a2d4454d0"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit2</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Unit2<span class="special">,</span> <span class="keyword">typename</span> YY<span class="special">&gt;</span> 
    <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> 
    <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1a0d81a4822546af1d6832677f9fe179c8"><span class="keyword">operator</span><span class="special">-=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit2</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Unit2<span class="special">,</span> <span class="keyword">typename</span> YY<span class="special">&gt;</span> 
    <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> 
    <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1a3334943ab558ace338ae0b608f7aa88a"><span class="keyword">operator</span><span class="special">*=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit2</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Unit2<span class="special">,</span> <span class="keyword">typename</span> YY<span class="special">&gt;</span> 
    <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> 
    <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1a2295f8100333e454ee1b3419450f7a24"><span class="keyword">operator</span><span class="special">/=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit2</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1afeb09a24afe9febd3663cc37478e384c"><span class="keyword">operator</span><span class="special">*=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1aec81e696c1fe36eeaf5862d73d85771e"><span class="keyword">operator</span><span class="special">/=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1units_1_1quantity.html#id-1_3_42_10_2_36_1_1_3_8-bb">public static functions</a></span>
  <span class="keyword">static</span> <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">this_type</span> <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1a640b4cf05fa9f056e03ad02286dd9af3"><span class="identifier">from_value</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1units_1_1quantity.html#id-1_3_42_10_2_36_1_1_3_9-bb">protected member functions</a></span>
  <span class="keyword">explicit</span> <a class="link" href="classboost_1_1units_1_1quantity.html#doxygen.units_reference.classboost_1_1units_1_1quantity_1a69cb1a16166b736d7853423a95fda68b"><span class="identifier">quantity</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">int</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.42.10.2.36.5.4"></a><h2>Description</h2>
<div class="refsect2">
<a name="id-1.3.42.10.2.36.5.4.2"></a><h3>
<a name="id-1_3_42_10_2_36_1_1_3_6-bb"></a><code class="computeroutput">quantity</code> private member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><pre class="literallayout"> <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1a0290aea428552371c2f3740da6a1d751"></a><span class="identifier">BOOST_MPL_ASSERT_NOT</span><span class="special">(</span><span class="emphasis"><em><span class="identifier">unspecified</span></em></span><span class="special">)</span><span class="special">;</span></pre></li></ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.42.10.2.36.5.4.3"></a><h3>
<a name="id-1_3_42_10_2_36_1_1_3_7-bb"></a><code class="computeroutput">quantity</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1a484474125b77a2e6ef9e1de01c8c54a9"></a><span class="identifier">quantity</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1a318bce2dda5327260598a283bf76e8ad"></a><span class="identifier">quantity</span><span class="special">(</span><span class="identifier">unspecified_null_pointer_constant_type</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1af73d7de246f97df78d4de8787afdde79"></a><span class="identifier">quantity</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> source<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1a3a16f2160d275e7f55db52552472bf65"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> source<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> YY<span class="special">&gt;</span> 
  <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1a705d20a31b83ed9f9d19c1bdbe2059b9"></a><span class="identifier">quantity</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span> source<span class="special">,</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre>implicit conversion between value types is allowed if allowed for value types themselves </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> YY<span class="special">&gt;</span> 
  <span class="keyword">explicit</span> <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1a4697636705c2804719498ff8640c8776"></a><span class="identifier">quantity</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span> source<span class="special">,</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre>implicit conversion between value types is not allowed if not allowed for value types themselves </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> YY<span class="special">&gt;</span> 
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> 
  <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1a3f47d4706ca778972a1a8edb9bed1688"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span> source<span class="special">)</span><span class="special">;</span></pre>implicit assignment between value types is allowed if allowed for value types themselves </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Unit2<span class="special">,</span> <span class="keyword">typename</span> YY<span class="special">&gt;</span> 
  <span class="keyword">explicit</span> <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1a00e7e3bc37ecff448f8a84ddbc5bdca0"></a><span class="identifier">quantity</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit2</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span> source<span class="special">,</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre>explicit conversion between different unit systems is allowed if implicit conversion is disallowed </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Unit2<span class="special">,</span> <span class="keyword">typename</span> YY<span class="special">&gt;</span> 
  <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1ad95a1c6209daa48be549a3e2801a1fa7"></a><span class="identifier">quantity</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit2</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span> source<span class="special">,</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre>implicit conversion between different unit systems is allowed if each fundamental dimension is implicitly convertible </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Unit2<span class="special">,</span> <span class="keyword">typename</span> YY<span class="special">&gt;</span> 
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> 
  <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1ac098018ddf73086447ee282dc65b7425"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit2</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span> source<span class="special">)</span><span class="special">;</span></pre>implicit assignment between different unit systems is allowed if each fundamental dimension is implicitly convertible </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CONSTEXPR</span> <span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span> <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1a140ecba6b11b57ba6c65d8f795d91e0c"></a><span class="identifier">value</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>constant accessor to value <p>can add a quantity of the same type if add_typeof_helper&lt;value_type,value_type&gt;::type is convertible to value_type </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Unit2<span class="special">,</span> <span class="keyword">typename</span> YY<span class="special">&gt;</span> 
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> 
  <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1a6a770b3a169018dcff09142a2d4454d0"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit2</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span> source<span class="special">)</span><span class="special">;</span></pre>can subtract a quantity of the same type if subtract_typeof_helper&lt;value_type,value_type&gt;::type is convertible to value_type </li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Unit2<span class="special">,</span> <span class="keyword">typename</span> YY<span class="special">&gt;</span> 
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> 
  <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1a0d81a4822546af1d6832677f9fe179c8"></a><span class="keyword">operator</span><span class="special">-=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit2</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span> source<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Unit2<span class="special">,</span> <span class="keyword">typename</span> YY<span class="special">&gt;</span> 
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> 
  <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1a3334943ab558ace338ae0b608f7aa88a"></a><span class="keyword">operator</span><span class="special">*=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit2</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span> source<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Unit2<span class="special">,</span> <span class="keyword">typename</span> YY<span class="special">&gt;</span> 
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> 
  <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1a2295f8100333e454ee1b3419450f7a24"></a><span class="keyword">operator</span><span class="special">/=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1units_1_1quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">Unit2</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span> source<span class="special">)</span><span class="special">;</span></pre>can multiply a quantity by a scalar value_type if multiply_typeof_helper&lt;value_type,value_type&gt;::type is convertible to value_type </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1afeb09a24afe9febd3663cc37478e384c"></a><span class="keyword">operator</span><span class="special">*=</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span> source<span class="special">)</span><span class="special">;</span></pre>can divide a quantity by a scalar value_type if divide_typeof_helper&lt;value_type,value_type&gt;::type is convertible to value_type </li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1aec81e696c1fe36eeaf5862d73d85771e"></a><span class="keyword">operator</span><span class="special">/=</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span> source<span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.42.10.2.36.5.4.4"></a><h3>
<a name="id-1_3_42_10_2_36_1_1_3_8-bb"></a><code class="computeroutput">quantity</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">this_type</span> <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1a640b4cf05fa9f056e03ad02286dd9af3"></a><span class="identifier">from_value</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span> val<span class="special">)</span><span class="special">;</span></pre>Construct quantity directly from <code class="computeroutput">value_type</code> (potentially dangerous). </li></ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.42.10.2.36.5.4.5"></a><h3>
<a name="id-1_3_42_10_2_36_1_1_3_9-bb"></a><code class="computeroutput">quantity</code> protected member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><pre class="literallayout"><span class="keyword">explicit</span> <a name="doxygen.units_reference.classboost_1_1units_1_1quantity_1a69cb1a16166b736d7853423a95fda68b"></a><span class="identifier">quantity</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span> val<span class="special">,</span> <span class="keyword">int</span><span class="special">)</span><span class="special">;</span></pre></li></ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.42.10.2.36.5.4.6"></a><h3>Specializations</h3>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="link" href="classboost_1_1units_1_1quantity_3_01BOOST__UNITS__DIMENSIONLESS__UNIT_07System_08_00_01Y_01_4.html" title="Class template quantity&lt;BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y&gt;">Class template quantity&lt;BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y&gt;</a></p></li></ul></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2003-2008 Matthias Christian Schabel<br>Copyright © 2007-2010 Steven
      Watanabe<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="structboost_1_1units_1_1add__typeof__helper_3_01quantity_3_01unit_3_01Dim1_00_01System1_01_4_00_c1e57319263083d9bd57c0be91d8b3ac.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_units/Reference.html#doxygen.units_reference.quantity_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="classboost_1_1units_1_1quantity_3_01BOOST__UNITS__DIMENSIONLESS__UNIT_07System_08_00_01Y_01_4.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
